using System;
using PSE.Hosting.ServiceHoster.Entities;

namespace PSE.Hosting.ServiceHoster.Services
{
    /// <summary>
    /// 
    /// </summary>
    internal static class ServiceTranslation
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public static DataContracts.Service ToDataContract(Entities.Service from)
        {
            DataContracts.Service to = new DataContracts.Service();
            to.Name = from.Name;
            to.IsAlive = from.IsAlive;
            //to.UserName = from.UserName;
            to.Assembly = from.Assembly;
            to.CodeBase = from.CodeBase;
            to.MexAddress = from.MexAddress;
            to.IsValid = from.IsValid;
            
            return to;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="from"></param>
        /// <returns></returns>
        public static Entities.Service ToBusinessEntity(DataContracts.Service from)
        {
            Entities.Service to = new Entities.Service();
            to.Name = from.Name;
            to.IsAlive = from.IsAlive;
            //to.UserName = from.UserName;
            to.Assembly = from.Assembly;
            to.CodeBase = to.CodeBase;
            to.IsValid = from.IsValid;
            return to;
        }
    }
}

